﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using main.sdk.input;

namespace main.src.game
{
    class Game_PlayerRod : Game_Rod
    {
        KeyWrapper KeyUp   = null;
        KeyWrapper KeyDown = null;
        public Game_PlayerRod(Game_Team Parent, KeyWrapper Up, KeyWrapper Down, float XPosition)
            : base(Parent, XPosition)
        {
            KeyUp = Up;
            KeyDown = Down;
        }

        public override void Update(double Time)
        {
            base.Update(Time);

            float TargetSpeed = 0;
            if (KeyUp.Down())
                TargetSpeed -= 100 * KeyUp.Value();
            if (KeyDown.Down())
                TargetSpeed += 100 * KeyDown.Value();

            this.SetMoveSpeed(TargetSpeed);
        }
    }
}
